﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CSharp9
{
    public abstract class Talk
    {
        public abstract void Speak();
        public virtual void Goodbye()
        {
            Console.WriteLine("Says goodbye");
        }
    }
    public class SayHello : Talk
    {
        public override void Speak()
        {
            Console.WriteLine("Says hello");
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            SayHello hello = new SayHello();
            hello.Speak();
            hello.Goodbye();
        }
    }
}
